import { request } from '@umijs/max';

// 获取用户列表
export async function getUserList(params: API.UserAdminParams) {
  return request<API.QueryResult>(`/users`, {
    method: 'GET',
    params,
    headers: {
      token: localStorage.getItem('token') || '',
    },
  });
}

// 解禁用户
export async function solveUser(ids: any[]) {
  return request('/users/0', {
    method: 'put',
    data: {
      ids,
    },
    headers: {
      token: localStorage.getItem('token') || '',
    },
  });
}

// 封锁用户
export async function forbidUser(ids: any[]) {
  return request('/users/1', {
    method: 'put',
    data: {
      ids,
    },
    headers: {
      token: localStorage.getItem('token') || '',
    },
  });
}
